#include "MultiLight.h"

MultiLight::MultiLight()
{
}

void MultiLight::Render(){
	blue.Render();
	yellow.Render();
	white.Render();
	magenta.Render();
	cyan.Render();
	red.Render();

}
void MultiLight::Init(int width,int length)
{
	blue.m_Light.Type=
	yellow.m_Light.Type=
	white.m_Light.Type=
	magenta.m_Light.Type=
	cyan.m_Light.Type=
	red.m_Light.Type=  D3DLIGHT_POINT;

	blue.m_Light.Theta=
	yellow.m_Light.Theta=
	white.m_Light.Theta=
	magenta.m_Light.Theta=
	cyan.m_Light.Theta=
	red.m_Light.Theta= D3DX_PI/16;

	blue.m_Light.Phi=
	yellow.m_Light.Phi=
	white.m_Light.Phi=
	magenta.m_Light.Phi=
	cyan.m_Light.Phi=
	red.m_Light.Phi= D3DX_PI/6;


	blue.m_Light.Direction=		D3DXVECTOR3(0.08, -1.0f, 0.08);
	yellow.m_Light.Direction=	D3DXVECTOR3(0, -1.0f,0.08);
	white.m_Light.Direction=	D3DXVECTOR3(-0.08, -1.0f,0.08);
	magenta.m_Light.Direction=	D3DXVECTOR3(0.08, -1.0f, -0.12);
	cyan.m_Light.Direction=		D3DXVECTOR3(0, -1.0f, -0.12);
	red.m_Light.Direction=		D3DXVECTOR3(-0.08, -1.0f, -0.12);


	blue.m_Light.Range=
	yellow.m_Light.Range=
	white.m_Light.Range=
	magenta.m_Light.Range=
	cyan.m_Light.Range=
	red.m_Light.Range=			 30.0f;


	blue.SetPosition(0.05*width,15,0.05*length);
	yellow.SetPosition(0.5*width,15,0.05*length);
	white.SetPosition(0.95*width,15,0.05*length);
	magenta.SetPosition(0.05*width,15,0.95*length);
	cyan.SetPosition(0.5*width,15,0.95*length);
	red.SetPosition(0.95*width,15,0.95*length);

	blue.m_Light.Attenuation0=
	yellow.m_Light.Attenuation0=
	white.m_Light.Attenuation0=
	magenta.m_Light.Attenuation0=
	cyan.m_Light.Attenuation0=		
	red.m_Light.Attenuation0=		5;


	blue.SetDiffuse(0.6,0.8,0.5);
	yellow.SetDiffuse(0.6,0.8,0.5);
	white.SetDiffuse(0.6,0.8,0.5);
	magenta.SetDiffuse(0.6,0.8,0.5);
	cyan.SetDiffuse(0.6,0.8,0.5);
	red.SetDiffuse(0.6,0.8,0.5);

	blue.Enable(true);
	yellow.Enable(true);
	white.Enable(true);
	magenta.Enable(true);
	cyan.Enable(true);
	red.Enable(true);

	AddObject(blue);
	AddObject(yellow);
	AddObject(white);
	AddObject(magenta);
	AddObject(cyan);
	AddObject(red);

	return;
};
MultiLight::~MultiLight(void)
{
}
